﻿<local:baseParametersPage x:Class="USMC.Net.rotaryTransducerParameters"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:USMC.Net"
      mc:Ignorable="d" 
	Title="rotaryTransducerParameters">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Label HorizontalAlignment="Center" Grid.Column="1" Grid.Row="0">X</Label>
        <Label HorizontalAlignment="Center" Grid.Column="2" Grid.Row="0">Y</Label>
        <TextBlock Grid.Column="0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Stretch">Использовать</TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="2" TextWrapping="Wrap" VerticalAlignment="Stretch">Остановиться при возникновении ошибки</TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="3" TextWrapping="Wrap" VerticalAlignment="Stretch">Шагов в полном обороте</TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="4" TextWrapping="Wrap" VerticalAlignment="Stretch">Максимальное смещение до ошибки</TextBlock>
        <TextBlock Grid.Column="0" Grid.Row="5" TextWrapping="Wrap" VerticalAlignment="Stretch">Сигнал сенсора</TextBlock>
        <CheckBox Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Name="enableChB" HorizontalAlignment="Center" VerticalAlignment="Center" Checked="enableChB_Checked" />
        <CheckBox Grid.Column="1" Grid.Row="2" Name="stopChB1" HorizontalAlignment="Center" VerticalAlignment="Center" IsEnabled="{Binding ElementName=enableChB, Path=IsChecked}" />
        <TextBox Width="60" Grid.Column="1" Grid.Row="3" Name="stepsPerRevTB1" HorizontalAlignment="Center" VerticalAlignment="Center" IsEnabled="{Binding ElementName=enableChB, Path=IsChecked}"/>
        <TextBox Width="60" Grid.Column="1" Grid.Row="4" Name="maxStepsTB1" HorizontalAlignment="Center" VerticalAlignment="Center" IsEnabled="{Binding ElementName=enableChB, Path=IsChecked}"/>
        <ToggleButton Grid.Column="1" Grid.Row="5" Name="logicalTogB1" HorizontalAlignment="Center" VerticalAlignment="Center" Width="20" IsEnabled="{Binding ElementName=enableChB, Path=IsChecked}">
            <ToggleButton.Style>
                <Style TargetType="{x:Type ToggleButton}">
                    <Setter Property="Content" Value="0"/>
                    <Style.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Content" Value="1"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ToggleButton.Style>
        </ToggleButton>
        <TextBox Width="60" Grid.Column="2" Grid.Row="3" Name="stepsPerRevTB2" HorizontalAlignment="Center" VerticalAlignment="Center" IsEnabled="{Binding ElementName=enableChB, Path=IsChecked}"/>
        <TextBox Width="60" Grid.Column="2" Grid.Row="4" Name="maxStepsTB2" HorizontalAlignment="Center" VerticalAlignment="Center" IsEnabled="{Binding ElementName=enableChB, Path=IsChecked}"/>
        <ToggleButton Grid.Column="2" Grid.Row="5" Name="logicalTogB2" HorizontalAlignment="Center" VerticalAlignment="Center" Width="20" IsEnabled="{Binding ElementName=enableChB, Path=IsChecked}">
            <ToggleButton.Style>
                <Style TargetType="{x:Type ToggleButton}">
                    <Setter Property="Content" Value="0"/>
                    <Style.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Content" Value="1"/>
                        </Trigger>
                    </Style.Triggers>
                </Style>
            </ToggleButton.Style>
        </ToggleButton>
        <CheckBox Grid.Column="2" Grid.Row="2" Name="stopChB2" HorizontalAlignment="Center" VerticalAlignment="Center" IsEnabled="{Binding ElementName=enableChB, Path=IsChecked}"/>
        <Button Name="resetButton" Grid.Column="0" Grid.Row="6" Grid.ColumnSpan="3" HorizontalAlignment="Center" VerticalAlignment="Center" Click="resetButton_Click">Сбросить флаг ошибки</Button>
    </Grid>
</local:baseParametersPage>
